<template>
	<view class="bg-white" style="min-height: 100vh;">
		<cu-custom title="用户评论"></cu-custom>
	
		<u-sticky offset-top="0" :customNavHeight="44" bgColor="#fff">
			<u-tabs @click="curriculumTypeTab" :list="curriculumTypeList" lineWidth="20" lineHeight="7"
				:lineColor="`url(/static/images/ico/active-bg.png) 100% 100%`" :activeStyle="{
			        color: '#ea3457',
			        fontWeight: 'bold',
			        transform: 'scale(1.05)'
			    }" :inactiveStyle="{
			        color: '#333',
			        transform: 'scale(1)'
			    }" itemStyle="padding-right: 30rpx; height: 100rpx;">
			</u-tabs>
		</u-sticky>
		<mescroll-body ref="mescrollRef" @down="downCallback" @up="upCallback" :up="upOption">
		<view class="padding">
			<comment :maxCount="6" />
		</view>
		</mescroll-body>
		<u-no-network></u-no-network>
	</view>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"
	import comment from './components/comment.vue' //评论
	export default {
		mixins: [MescrollMixin], // 使用mixin
		components: {
			comment
		},
		data() {
			return {
				// 上拉加载的配置(可选)
				upOption: {
					use: true, //是否启用上拉加载
				},
				
				curriculumIndex: 0,
				curriculumTypeList: [{
					name: '全部（11545）'
				}, {
					name: '晒图（135）',
				}, {
					name: '低分（5684）',
				}, {
					name: '最新',
				}],
			}
		},
		props: {

		},
		onShow() {

		},
		methods: {
			//切换Tab
			curriculumTypeTab(item) {
				this.curriculumIndex = item.index
			},
			
			//下拉刷新
			downCallback() {
				this.mescroll.resetUpScroll(); // 重置列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
			},
			/*上拉加载的回调*/
			upCallback(page) {
				let pageNum = page.num; // 页码, 默认从1开始
				// this.getList(pageNum)
				this.mescroll.endErr(); // 请求失败,隐藏加载状态
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>
